package us.wili.dev.netty.model.potodto;

import org.springframework.beans.BeanUtils;
import us.wili.dev.model.entity.User;
import us.wili.dev.netty.model.game.Room;
import us.wili.dev.netty.model.game.Player;

import java.util.UUID;

public class PlayerPoToDtoUtil {

    public static Player copyUserToPlayer (User user, UUID session, Room room){
        Player player = new Player();
        if (user!=null){
            BeanUtils.copyProperties(user,player);
        }
        player.setSession(session);

        player.setRoom(room);
        return player;
    }
}
